/*#################################################

Modal | v1.1 
Max Felker | max@bigroomstudios.com

Modal window overlay

#################################################*/
 
// START Class
var Modal = Class.create({

	initialize: function() {},
	
	display: function(config) {
		
		config.container = "modal";
		config.minimize = false;
		config.drag = false;
			
		live.canopy.display();
		live.canopy.btn_close.hide();
		
		this.popup = new Popup(config);
		
		this.popup.btn.close.on('click', function() {
			live.canopy.close()
		});
		
		live.keys.stop_looking_for('esc');
		
		live.keys.look_for('esc',function() {

        	live.modal.close();
        		
       	});
	
	},
	
	close: function() {
	
		if(this.popup) {
			this.popup.close();
		}
		
		live.canopy.close();

	}

}); // END Class 
